<?PHP
// Simple todo list manager
// Written by tibone
if (isset($_POST['submit'])) 
{
$myFile = "todo.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $_POST['todo'];
fwrite($fh, $stringData);
fclose($fh);
}
$todolist = file_get_contents('todo.txt');
?>
<html>
<head>
<title>tibone's todo list</title>
</head>
<body>
<br>
<br>
<br>
<center>
<form name="form1" action="<?PHP echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
<textarea rows="30" cols="90" name="todo"><?PHP echo $todolist; ?></textarea><br>
<input type="submit" name="submit" value="Save">
</form>
</center>
</br>
</body>
</html>